package com.auto.api.admin.api;

import com.auto.api.admin.dto.AdminApiDTO;
import com.auto.api.admin.dto.result.ApiInfoDTO;
import com.auto.api.common.entity.NullObj;
import com.auto.api.common.entity.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author liangshf
 * @Description: Description:ApiInfoApi接口服务
 * @date 2018-11-01
 */
@FeignClient(value = "ADMIN-SERVER")
public interface ApiInfoApi {

    /**
     * api接口基础路径
     */
    String API_BASE_PATH = "/api/admin/";

    /**
     * 保存提取Api结果
     *
     * @param adminApi AdminApiDTO api 管理对象
     * @return ResponseData
     */
    @PostMapping(value = API_BASE_PATH + "saveApiList")
    ResultData<NullObj> saveApiList(@RequestBody AdminApiDTO adminApi);
    
    /**
     * 获取ControlMapping
     *
     * @param url String
     * @return ResponseData
     */
    @GetMapping(value = API_BASE_PATH + "getApiByUrl")
    ResultData<ApiInfoDTO> getApiByUrl(@RequestParam("url") String url);
    
}
